package cn.znzz.cjm.basic.util;

import lombok.Data;

@Data
public class AjaxResult {
    private boolean success = true;
    private String message = "操作成功!";
    //成功的参数
    private Object resultObj;

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }

    public static AjaxResult me(){//成功
        return new AjaxResult();
    }

    /**链式编程思维*/
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }
}
